Repository navigation
[Fix/#128] 사물함 신청 모집 기간 검증 추가 - #130
Open
sangrae2325 wants to merge 1 commit into
Open
sangrae2325 wants to merge 1 commit into
sangrae2325 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
github-actions
Bot
requested review from
jjunh33,
leegain1,
tnals0924 and
xeoxxn
October 16, 2026 10:26
sangrae2325
added this pull request to stack #131
October 16, 2026 10:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣연관된 이슈
main으로 바꿉니다apply_end_at을 확인하지 않는다"를 닫습니다🎯 해결하려는 문제가 무엇인가요?
학생이 사물함을 신청할 때 서버가 모집 기간을 확인하지 않습니다.
LockerApplicationServiceImpl.apply가 보는 건 "게시된 회차인가"와 "선택 가능한 사물함인가" 둘뿐이라, 모집 시작 전이나 마감된 뒤에도 신청이 들어갑니다.LockerPeriod의applyStartAt·applyEndAt은 지금 엔티티 매핑 말고는 읽는 곳이 한 곳도 없습니다.❓ 왜 해결해야 하나요?
지금은 마감이 운영진 손에 달려 있습니다.
apply_end_at이 지나도 누군가 게시를 내리기 전까지 신청이 열려 있고, 그 사이 들어온 신청은 유효하게 남습니다.사물함은 선착순 즉시 배정이라 피해가 바로 생깁니다. 마감 후 신청이 다른 학생이 못 가져간 자리를 차지하고, 신청 취소 기능이 없어 되돌리려면 DB를 직접 고쳐야 합니다.
게시는 모집 시작 전에 미리 켜는 게 자연스럽습니다("곧 시작합니다"를 보여주려고). 그 상태에서 API를 직접 부르면 시작 전에 먼저 집어갈 수 있습니다.
같은 모듈의 행사 신청은 이미 막고 있습니다.
EventApplicationServiceImpl.getOpenEvent가calculateRecruitStatus(now, appliedCount)로 기간과 정원을 보고ALREADY_CLOSED를 던집니다. 사물함만 빠져 있었습니다.⭐ 어떻게 해결했나요?
행사와 같은 모양으로, 회차를 읽은 직후 모집 기간을 봅니다.
LockerPeriod.isApplyOpen(LocalDateTime now)— 신청 시작 일시부터 마감 일시까지 양 끝 포함LockerApplicationServiceImpl.apply에서requireApplyOpen(period)호출LockerErrorCode.LOCKER_APPLY_NOT_OPEN(409)사용 기간은 보지 않습니다. 사용을 시작한 뒤 남은 자리를 추가 모집하려고 마감 일시를 늘리는 운영이 있어 두 기간이 겹칠 수 있습니다. #129의 등록·수정도 같은 기준입니다.
🧩 이 PR의 한계 & 트레이드오프
LOCKER_APPLY_NOT_OPEN하나로 갔습니다. 행사도ALREADY_CLOSED하나로 처리합니다. 나누려면..._NOT_STARTED/..._CLOSED둘이 됩니다AGENTS.md원칙에 따랐습니다. 기존신청 거절중첩 클래스에 한 건 추가할 자리는 있습니다⛓️ 기존 기능에 미치는 영향
2026-08-20 ~ 08-25로 고정돼 있어 지금은 마감 상태입니다. 어떤 고정 날짜를 넣어도 언젠가 깨지므로 현재 시각 기준(now ± 5일)으로 바꿨습니다. 테스트가 옛 동작(기간 무시)을 박아두고 있던 것이지 버그는 아닙니다🔀 Edge Case & 실패 시나리오
LOCKER_APPLY_NOT_OPEN(409)LOCKER_APPLY_NOT_OPEN(409)LOCKER_PERIOD_NOT_FOUND(404). 기간 검사보다 먼저 걸린다📋 검토한 대안과 선택 이유
is_published를 신청 개폐 레버로 계속 쓰기: #129가 등록 시true로 고정하면서 그 레버가 없어집니다. 마감은 시각이 정하는 쪽이 맞습니다💬 리뷰 포인트
[c]시작 전/마감 후를 한 코드로 묶은 것 — 앱에서 문구를 나눠야 하면 쪼개겠습니다[c]테스트 픽스처를 현재 시각 기준으로 바꾼 것 — 고정 날짜를 유지하면서 거는 방법이 있다면[a]신청 거절테스트 한 건 추가 여부검증 범위
compileJava·compileTestJava,:core:domain:event:test(121건),:infrastructure:db:test(Testcontainers) 통과했습니다.